/**
 * [268] 丢失的数字
 *
 * @format
 * @lc app=leetcode.cn id=268 lang=javascript
 */

// @lc code=start
/**
 * @param {number[]} nums
 * @return {number}
 */
var missingNumber = function (nums) {
    const dict = {}
    nums.forEach((e) => {
        dict[e] = true
    })
    for (let i = 0; i <= nums.length; i++) {
        if (!dict[i]) return i
    }
}
// @lc code=end
